var navBtn = document.querySelector('.nav-open');
var nav = document.querySelector('nav ul');
navBtn.onclick=function(){
	if(nav.style.height=="500px"){
		nav.style.height="0"
        
	}else{
		nav.style.height="500px"
	}
}

var op = document.querySelectorAll('.list-op span')
var item = document.querySelectorAll('.item');
var listLeft = document.querySelector('.list-sp .left')
var listRight = document.querySelector('.list-sp .right')
var index = 0;

function inplay(num){
	item[index].className="item";
	for(var j = 0; j<op.length;j++){
	    op[j].style.background= "#666666";
	}
	op[index].style.background = "#666666"
	if(num){
        index--;
    }else{
    	index++;
    }
	if(index>2){
        index=0;
    }else if(index<0){
       index=2
    }
	item[index].className="item active";
   	op[index].style.background = "#0086da"
}
setInterval(function(){
	inplay()
},5000)
listLeft.onclick=function(){
	inplay(1)
}
listRight.onclick=function(){
	inplay()
}